//
//  YFLmvTableViewCell.m
//  Music
//
//  Created by dllo on 16/6/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YFLmvTableViewCell.h"

@implementation YFLmvTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.leftMainImageView =[[UIImageView alloc]init];
        //self.leftMainImageView.backgroundColor =[UIColor greenColor];
        [self.contentView addSubview:self.leftMainImageView];
        
        
        self.titleLabel= [[UILabel alloc]init];
        //self.titleLabel.backgroundColor =[UIColor orangeColor];
        [self.contentView addSubview:self.titleLabel];
        
        
        self.singerLabel =[[UILabel alloc]init];
       // self.singerLabel.backgroundColor =[UIColor yellowColor];
        [self.contentView addSubview:self.singerLabel];
        self.singerLabel.adjustsFontSizeToFitWidth = YES;
        
        
        self.kindLabel =[[UILabel alloc]init];
        //self.kindLabel.backgroundColor =[UIColor redColor];
        [self.contentView addSubview:self.kindLabel];
        
        self.startLabel =[[UILabel alloc]init];
       // self.startLabel.backgroundColor =[UIColor cyanColor];
        self.startLabel.font =[UIFont systemFontOfSize:10];
        [self.contentView addSubview:self.startLabel];
        
        
        self.commentLabel =[[UILabel alloc]init];
       // self.commentLabel.backgroundColor =[UIColor purpleColor];
        self.commentLabel.font =[UIFont systemFontOfSize:10];
        [self.contentView addSubview:self.commentLabel];
        
        
        self.startImageView =[[UIImageView alloc]init];
       // self.startImageView.backgroundColor =[UIColor redColor];
        [self.contentView addSubview:self.startImageView];
        
        self.commentImageView =[[UIImageView alloc]init];
       // self.commentImageView.backgroundColor =[UIColor blueColor];
        [self.contentView addSubview:self.commentImageView];
        
        
        
    }
    return self;
}


-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.leftMainImageView.frame = CGRectMake(20, 10, Screenwidth/3, 70);
    
    self.titleLabel.frame = CGRectMake(self.leftMainImageView.frame.origin.x+self.leftMainImageView.frame.size.width+10, self.leftMainImageView.frame.origin.y, Screenwidth/2, 15);
    
    self.singerLabel.frame = CGRectMake(self.titleLabel.frame.origin.x, self.titleLabel.frame.origin.y+self.titleLabel.frame.size.height+5, 60, self.titleLabel.frame.size.height);
    
    self.startImageView.frame = CGRectMake(self.singerLabel.frame.origin.x, self.singerLabel.frame.size.height+10+self.singerLabel.frame.origin.y, 15, 15);
    
    self.startLabel.frame = CGRectMake(self.singerLabel.frame.origin.x+15, self.singerLabel.frame.size.height+10+self.singerLabel.frame.origin.y, self.singerLabel.frame.size.width*2, self.singerLabel.frame.size.height);
    
    self.commentImageView.frame = CGRectMake(self.startLabel.frame.origin.x+self.startLabel.frame.size.width, self.startLabel.frame.origin.y, 15, 15);
    self.commentLabel.frame = CGRectMake(self.startLabel.frame.origin.x+self.startLabel.frame.size.width+15, self.startLabel.frame.origin.y, self.startLabel.frame.size.width, self.startLabel.frame.size.height);
    
    
    
    
}
-(void)setMvModel:(YFLmvModel *)mvModel
{
    if (_mvModel != mvModel) {
        _mvModel = mvModel;
        
        [self.leftMainImageView sd_setImageWithURL:[NSURL URLWithString:mvModel.picUrl] placeholderImage:[UIImage imageNamed:@"占.jpg"]];
       
        self.titleLabel.text = mvModel.videoName;
        
       self.singerLabel.text = mvModel.singerName;
        
        self.startLabel.text = mvModel.pickCount.description;
        
        self.commentLabel.text = mvModel.bulletCount.description;
        
        self.startImageView.image =[UIImage imageNamed:@"startssss"];
        
        self.commentImageView.image =[UIImage imageNamed:@"commentssss"];
        
    }
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
